import request from '@/utils/request'
// 获取权限列表
export function getRoleList(data) {
  return request({
    url: '/system/role/list',
    method: 'get',
    params: data
  })
}
// 获取单个权限
export function getRole(roleId) {
  const data = { roleId: roleId }
  return request({
    url: '/system/role/one',
    method: 'post',
    data
  })
}
// 添加权限
export function addRole(data) {
  return request({
    url: '/system/role/add',
    method: 'post',
    data
  })
}
// 更新权限
export function updateRole(data) {
  return request({
    url: '/system/role/edit',
    method: 'post',
    data
  })
}
// 删除权限
export function deleteRole(roleId) {
  const data = { roleId: roleId }
  return request({
    url: '/system/role/delete',
    method: 'post',
    data
  })
}
